#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QDebug>
#include <QString>
#include <QPushButton>
#include <QTcpServer>
#include <QTcpSocket>
#include <QTextStream>
#include <QByteArray>

namespace Ui {
class Dialog;
}

class Dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

private:
    Ui::Dialog *ui;
    QTcpServer *server;
    QTcpSocket *socket = NULL;  // 通信对象（这样只能存一个）
    QString str;
    QString temperatureStr;
    QString humidityStr;
    int mode;
    float temperature = 0.0;
    float humidity = 0.0;
private slots:
    void newConnectionSlot();
    void disconnectSlot();
    void readyReadSlot();
    void btnOneSlot();
    void btnTwoSlot();
    void btnTrhSlot();


};

#endif // DIALOG_H
